<?php 
$mktime=mktime(date('his'));
$tr=$mktime.'tr';
$divlistado=$mktime.'listado';
$carg=$mktime;
$i_edit = $this->For->img('iconos/icons/editar.png','Editar Datos del Productor','Editar');
$i_bor = $this->For->img('iconos/icons/borrar.png','Eliminar Datos del Productor','Eliminar');
$i_nuevo = $this->For->img('iconos/icons/nuevo.png','Nuevo Registro','Nuevo');

echo "<br /><br /><div id='$divlistado'>";
?>
<table border='0' cellpadding='0' cellspacing='0' width='95%' align='center' style='border:10;'>
	<tr>
		<td>&nbsp;</td>
		<td width='62px'>
			<?=$this->Json->tipsayuda('nuevo1','Haga Click para registrar un nuevo Usuario','nuevo');?>
			<div align='right' id='nuevo1' style="border-top: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
				<div onclick="<?=$this->For->ajax('','TARJETAPRODUCTIVA/nuevo/nuevo1/'.$divlistado,$carg);?>">
						&nbsp;<?=$this->For->accion($i_nuevo);?>
				</div>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan='2'>
		<?
				$this->Json->tipsayuda($tr,'Haga Doble Click sobre el listado para ampliar','listado');
				$this->Json->lisamplia('t'.$mktime);
				if(count($data)>0) 
				{
						$this->For->table($mktime);
						$this->For->tr($mktime,'',$tr);
						$this->For->td('<b>#</b>','','c','20px');
						$this->For->td('<b>CEDULA O RIF</b>','','c');
						$this->For->td('<b>NOMBRE</b>','','c');
						$this->For->td('<b>APELLIDO</b>','','c');
						$this->For->td('<b>DIRECCION</b>','','c');
						$this->For->td('<b>FECHA N.</b>','','c');
						$this->For->td('<b>SEXO</b>','','c');
						$this->For->td('<b>CELULAR</b>','','c');
						$this->For->td('<b>ESTATUS</b>','','c');
						$this->For->td('<b>ACCION</b>','','c','60px');
						$this->For->tr('');
						for($z=0; $z<count($data); $z++)
						{ 
								$mode='Productor';
								if ($z % 2 == 0) $class = "#FFFFFF"; else $class = "#F0F0F0";
								$id=$this->For->id('',$data[$z][$mode]['id']);
								$t1=$id.'ayuda';
								$t2=$id.'links';
								$pre=$id.'preg';
								$num=$this->For->font($this->For->armar_numero(($z+1)));
								$a=$data[$z][$mode]['ced_rif'];
								$b=$data[$z][$mode]['nombre'];
								$c=$data[$z][$mode]['apellido'];
								$d=$data[$z]['Estado']['nombre']."/".$data[$z]['Municipio']['nombre']."/".$data[$z]['Parroquia']['nombre']."/".$data[$z]['Productor']['direccion'];
								$e=$data[$z][$mode]['fecha_nacimiento'];
								$f=$data[$z][$mode]['sexo'];
								$h=$data[$z][$mode]['tlf_celular'];
								$g=$data[$z][$mode]['estatus'];
								$this->Json->tipsayuda($t1,"$num $a $b $c $d $e $f $g $h",'info',400);
								$this->For->tr($mktime,$class,$t1);
								$this->For->td($num,$busq,'r');
								$this->For->td($a,$busq);
								$this->For->td($b,$busq);
								$this->For->td($c,$busq);
								$this->For->td($d,$busq);
								$this->For->td($e,'','c');
								$this->For->td($f,$busq);
								$this->For->td($g,'');
								$this->For->td($h,'');
								$eve_ver=$this->For->ajax('',"TARJETAPRODUCTIVA/ver_dato_productor/1/$t2/$divlistado/$id",$carg);
								$eve_edit=$this->For->ajax('',"TARJETAPRODUCTIVA/ver_dato_productor/2/$t2/$divlistado/$id",$carg,null,array($pre,'¿DESEAS MODIFICAR LOS DATOS DEL PRODUCTOR?'));
								echo "<td width='auto' id='$t2'";
								?>
								<div id="<?=$pre;?>" onclick="<?=$eve_ver;?>">&nbsp;<?=$this->For->accion($i_ver);?></div>
								<div id="<?=$pre;?>" onclick="<?=$eve_edit;?>">&nbsp;<?=$this->For->accion($i_edit);?></div>
								<?="</td>";
								$this->For->tr('');
						} 
						$this->For->table('');
				}
				else 
				{
						$this->For->table($mktime);
						$this->For->tr($mktime,'#FFFFFF',$tr);
						$this->For->td("<font color='red' size='-1'>No Se Encrontraron Registros con esa Busqueda </font>",'','c','100%');
						$this->For->tr('');
						$this->For->table('');
				}
				?>
		</td>
	</tr>

<?php
	if(count($data)>20) 
	{ 
?>
		<tr>
			<td>&nbsp;</td>
			<td width='62px'>
					<?=$this->Json->tipsayuda('nuevo2','Haga Click para registrar un nuevo Productor','nuevo');?>
					<div align='center' id='nuevo2' style="border-bottom: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
						<div onclick="<?=$this->For->ajax('','TARJETAPRODUCTIVA/nuevo/nuevo2/'.$divlistado,$carg);?>">&nbsp;<?=$this->For->accion($i_nuevo);?></div>
					</div>
			</td>
		</tr>
<? } ?>
</table>
<? echo '<br /><br />'; echo'</div>';?>
<?="<div id='$carg'></div>";?>

<?//=$this->Json->listado();?>





